Title: Table borders and column widths
Last modified: August 19, 2016

---

# Table borders and column widths

 *  [boofwei](https://wordpress.org/support/users/boofwei/)
 * (@boofwei)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/table-borders-and-column-widths/)
 * Hi, I’m new to all of this, but understand a little html. I’m having trouble 
   putting borders into my tables. If I use rules=”all” (or any other value”), the
   cellspacing=”value” and cellpadding=”value” (I’ve tried different values all 
   the way up to 50) commands are ignored, my table scrunches together. How do I
   solve this?
 * Example of my code:
 * `<span style=”text-decoration: underline;”>Informatieavonden in 2009</span>:
   
   <table border=”1″ cellspacing=”value” cellpadding=”value” rules=”all”> <tbody
   style=”font-size:75%”> <tr> <td width=”50″>Gem.:</td> <td colspan=”3″>Datum:</
   td> <td width=”80″>Tijd:</td> <td width=”70″>Locatie:</td> </tr> <tr> <tr> <td
   >De Rijp</td> <td width=”20″>do</td> <td width=”20″></td> <td width=”30″>mei</
   td> <td></td> <td></td> </tr> <tr> <td></td> <td>ma</td> <td>29</td> <td>jun</
   td> <td></td> <td></td> </tr> <tr> <td>Edam</td> <td>do</td> <td>23</td> <td>
   apr</td> <td></td> <td></td> </tr> <tr> <td></td> <td>di</td> <td>1</td> <td>
   sep</td> <td>20.00-22.00 u</td> <td>De Singel</td> </tr> <tr> <td>Velsen</td>
   <td>di</td> <td>16</td> <td>juni</td> <td></td> <td></td> </tr> <tr> <td></td
   > <td>ma</td> <td>31</td> <td>aug</td> <td>19.30-21.30 u</td> <td>Het Mosterdzaadje
   </td> </tr> <tr> <td>Westzaan</td> <td>wo</td> <td>17</td> <td>juni</td> <td>
   19.30-22.00 u</td> <td>De Kwaker</td> </tr> </tbody></table>

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [adamjb](https://wordpress.org/support/users/adamjb/)
 * (@adamjb)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/table-borders-and-column-widths/#post-1189278)
 * I don’t really understand your question, but here are a couple resources:
 * [http://mondaybynoon.com/2009/04/20/taking-advantage-of-what-tables-have-to-offer/](http://mondaybynoon.com/2009/04/20/taking-advantage-of-what-tables-have-to-offer/)
 * [http://www.smashingmagazine.com/2006/12/29/css-based-tables-modern-solutions/](http://www.smashingmagazine.com/2006/12/29/css-based-tables-modern-solutions/)
 *  [adamjb](https://wordpress.org/support/users/adamjb/)
 * (@adamjb)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/table-borders-and-column-widths/#post-1189281)
 * I opened your code in a browser and I see what you mean, I think. You need to
   delete the <tr> after your first row, you have an extra one.
 * Or you can just copy this:
 *     ```
       <table border="1" cellspacing="value" cellpadding="value" rules="all">
       <tbody style="font-size:75%">
       <tr>
       <td width="50">Gem.:</td>
       <td colspan="3">Datum:</td>
       <td width="80">Tijd:</td>
       <td width="70">Locatie:</td>
       </tr>
       <tr>
       <td>De Rijp</td>
       <td width="20">do</td>
       <td width="20"></td>
       <td width="30">mei</td>
       <td></td>
       <td></td>
       </tr>
       <tr>
       <td></td>
       <td>ma</td>
       <td>29</td>
       <td>jun</td>
       <td></td>
       <td></td>
       </tr>
       <tr>
       <td>Edam</td>
       <td>do</td>
       <td>23</td>
       <td>apr</td>
       <td></td>
       <td></td>
       </tr>
       <tr>
       <td></td>
       <td>di</td>
       <td>1</td>
       <td>sep</td>
       <td>20.00-22.00 u</td>
       <td>De Singel</td>
       </tr>
       <tr>
       <td>Velsen</td>
       <td>di</td>
       <td>16</td>
       <td>juni</td>
       <td></td>
       <td></td>
       </tr>
       <tr>
       <td></td>
       <td>ma</td>
       <td>31</td>
       <td>aug</td>
       <td>19.30-21.30 u</td>
       <td>Het Mosterdzaadje</td>
       </tr>
       <tr>
       <td>Westzaan</td>
       <td>wo</td>
       <td>17</td>
       <td>juni</td>
       <td>19.30-22.00 u</td>
       <td>De Kwaker</td>
       </tr>
       </tbody></table>
       ```
   
 *  Thread Starter [boofwei](https://wordpress.org/support/users/boofwei/)
 * (@boofwei)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/table-borders-and-column-widths/#post-1189298)
 * Thanks for your fast response! I couldn’t find the extra <tr>, but I copied your
   code in. I still have the problem. I’ll check with the other sources you mention,
   thanks.
 * But what I’m trying to do is make a table with four columns with a fixed with.
   Without borders, I can control cellspacing and cellpadding. But then, of course,
   I have a table with content floating around in free space.
    However, as soon 
   as I put borders in, such as with `rules="all"`, the column widths shrink to 
   fit on whatever the largest entry is in the table. So I have borders around the
   cells, but the content is jammed up against the sides of the cells. No matter
   what value I set for cellspacing or cellpadding, the column width stays minimalized.
 * … hmm, I normally work on a Mac (Firefox), but I’m sitting on a PC at the moment,
   and I notice here, that the cellspacing and cellpadding work, and rules doesn’t.
 * There is definitely some kind of conflict between cellspacing and cellpadding
   with rules.
 *  [adamjb](https://wordpress.org/support/users/adamjb/)
 * (@adamjb)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/table-borders-and-column-widths/#post-1189332)
 * You should use CSS to style your table. I think it’s easier than what you are
   doing. So if you want to change your cell padding just add this below to your
   css style sheet:
 *     ```
       td {
       	padding-left:10px;
       	padding-right:10px;
       }
       ```
   
 * You can also change the cell spacing by doing the same thing, but instead using
   the “margin-left” (or right, top, bottom).
 * I’m sorry if you already know this, or if it’s totally not what you needed to
   know.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Table borders and column widths’ is closed to new replies.

## Tags

 * [Borders](https://wordpress.org/support/topic-tag/borders/)
 * [cellpadding](https://wordpress.org/support/topic-tag/cellpadding/)
 * [rules](https://wordpress.org/support/topic-tag/rules/)
 * [tables](https://wordpress.org/support/topic-tag/tables/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [adamjb](https://wordpress.org/support/users/adamjb/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/table-borders-and-column-widths/#post-1189332)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
