the Rift


Code A Quick Guide to Tables

Psyche the DarkEmpress Posts: 380
Deceased
Mare :: Unicorn :: 15.3 hh :: 8 (ages in Orangemoon) Buff: ENDURE
RayoDeSoleil
#1
Basic Table Creation

Basics

So the first thing you need to understand in order to create a table is a brief overview of how HTML works.

You begin with something called "tags' that basically define an HTML element. For example:

Code:
<p>This is a paragraph.</p>

In this example, the <*p> and <*/p> are the tags, and they define a paragraph.

Basic Table Information

Let’s take a look at a basic table’s tags, shall we?

Code:
<table>

<tr>

<td>Information goes here.</td>

</tr>

</table>

To break this down: the <*table> tags define the entire table, the <*tr> tags designate rows, and the <*td> tags designate columns. Column tags will ALWAYS go inside row tags, otherwise your table will not work. This means that a table with one row and three columns will look like this:

This is Column 1. This is Column 2. This is Column 3.

Code:
<table>

<tr>

<td>This is Column 1.</td>

<td>This is Column 2.</td>

<td>This is Column 3.</td>

</tr>

</table>

A table with three rows and one column will look like this:

This is Row 1.
This is Row 2.
This is Row 3.

Code:
<table>

<tr>

<td>This is Row 1.</td>

</tr>

<tr>

<td>This is Row 2.</td>

</tr>

<tr>

<td>This is Row 3.</td>

</tr>

</table>

Styling

Okay, good. Now that you understand how tables are built, you can start thinking about styling them. Now, there are a LOT of different ways to style a table, and in order to learn every single thing you can do, I recommend w3schools. This is a fantastic resource for anyone learning HTML or any other kind of coding, and it’s also a great place to look in case you forget how to do something. Oh, and did I mention it's free?

Anyway, I'll list some of the main HTML styling things that you're likely to use below.

Note: I recommend using "px" after any given number, as it makes it much easier to scale and it defines for your browser that you are using pixels.

Width :: defines the width of an element :: looks like
Code:
<table width="600px"></table>
where "number" = the width in pixels.

Cell Padding :: defines the amount of space between the content and the border of any given cell :: looks like
Code:
<table cellpadding="10px"></table>
where "number" = the amount in pixels.

Align :: defines where the table is on the page :: looks like
Code:
<table align="center"></table>
where "alignment" = left, center, right, or justify.
*For use on Helovia, I recommend center.

Border :: defines the border of the table :: looks like
Code:
<table border="1"></table>
where "number" = the width of the border (0 will show no border).
*I recommend CSS styling for borders, but that is another story altogether.

Background :: defines the background of the table :: looks like
Code:
<table bgcolor="#000000"></table>

So how do these different things coincide? Why, I'm so glad you asked! Below, I have a table that is 500px wide, has a border, is center aligned, has 10px padding, and has a grey background.

I am a table. I have two columns.
Look at me! I also have two rows!

Code:
<table align="center" width="500px" border="1" cellpadding="10px">

<tr>

<td>I am a table.</td>
<td>I have two columns.</td>

</tr>

<tr>

<td>Look at me!</td>
<td>I also have two rows!</td>

</tr>

</table>

Applications

So you're probably wondering how this translates to use on Helovia, or any other RP, for that matter. Well, I'm glad you asked! Most of the time, basic tables on RPs feature one column and multiple rows. Of course, there are all kinds of other complex tables, but I suggest looking at other codes for that. You can learn a lot from looking at what someone else had done!

Anyway, your basic table around here is going to be composed of an image in either the top or bottom row and text in another row. It might look something like this:

Text goes here!
And don't forget your Credits!


Code:
<table align="center" width="500px" border="0" cellpadding="10px" bgcolor="#000000">

<tr>

<td><img src="http://fc08.deviantart.net/fs71/f/2013/106/6/6/_trade___a_r_c_h_i_b_a_l_d__by_rayodesoleil-d61xzr6.jpg" width="500px" /></td>

</tr>

<tr>

<td>Text goes here!</td>

</tr>

</table>

<center>And don't forget your <a href="http://rayodesoleil.deviantart.com">Credits</a>!</center>

You can change font colors with the basic font color editor in our reply areas, or with CSS.

So I think that concludes my basic table tutorial, so I hope this has helped someone. If you have any questions, feel free to ask!
[Image: psycheicon.png]

Please feel free to tag me in all replies!
Use of force and/or magic (with the exception of death) is allowed at all times.

Africa the Starry-Eyed Posts: 727
Deceased
Mare :: Pegasus :: 16 :: 6 (Tallsun) Buff: NOVICE
Silas :: Common Zephyr :: Roc Riven
#2
Thank you :)

Archibald the Dauntless Posts: 386
Absent Abyss atk: 6.0 | def: 9.5 | dam: 8
Stallion :: Equine :: 18.3 hh :: 10 years HP: 80 | Buff: SHIELD
Loretta :: Alaskan Malamute :: Time Slip Time
#3
STEALS ANOTHER ARCHI TABLE HAHAHAH


Through the ages of time
I've been known for my hate,
but I'm a dealer of simple choices;
for me it's never too late.


please tag me

Onni the Illuminant Posts: 194
Hidden Account
Mare :: Pegasus :: 15.2hh :: 8 Buff: SWIFT
Lyhty :: Diamond Firetail Finch :: Sing Boom Boom!
#4
Thanks, Rayo! I'm going to sticky this. ^^

Psyche the DarkEmpress Posts: 380
Deceased
Mare :: Unicorn :: 15.3 hh :: 8 (ages in Orangemoon) Buff: ENDURE
RayoDeSoleil
#5
You're welcome, Riven!

xD Time. <3333333

Thanks, Boom! Hopefully someone will find it useful. :3
[Image: psycheicon.png]

Please feel free to tag me in all replies!
Use of force and/or magic (with the exception of death) is allowed at all times.

Peppermint Posts: N/A
Unregistered
:: :: ::
#6
Question:how do you change the color of your font or background?

Psyche the DarkEmpress Posts: 380
Deceased
Mare :: Unicorn :: 15.3 hh :: 8 (ages in Orangemoon) Buff: ENDURE
RayoDeSoleil
#7
If you notice in the first line of the table code, here:

Code:
<table align="center" width="500px" border="0" cellpadding="10px" bgcolor="#000000">

there is a 'bgcolor' option. The 6 digit hex code for the color you want needs to be put there, so in the quotes it should be "#xxxxxx".

As for font color, I recommend using the color editor that is built into this forum, but if you want to get into actual HTML/CSS font coloring and whatnot, the simplest way is to do this:

Code:
<table>

<tr>

<td>

<font color="#xxxxxx">Your text here.</font>

</td>

</tr>

</table>

If you notice, it's the same basic concept - just input your color's hex code into the quotes!

Hope this helps. :)
[Image: psycheicon.png]

Please feel free to tag me in all replies!
Use of force and/or magic (with the exception of death) is allowed at all times.

Ghost the Cadaverous Posts: 219
Outcast atk: 5.5 | def: 10.5 | dam: 5.5
Mare :: Hybrid :: 16hh :: 6 years HP: 67 | Buff: ENDURE
Fantôme :: Grey Wolf :: None imi
#8
Thanks a lot! :) this is really helpful
Let the heat of the sun
Reignite your memory
Because if we just turn and run
Let them fire the gun

❚ Force permitted, just don't kill her :3
❚ Please tag me!
❚ Pixel by Nyte


Forum Jump:


RPGfix Equi-venture