Hi. I wanted to ask this a long time ago.. but never get the chance.
How do I actually style the table td to the width I wanted? It didn't happen for me.
It didn't happen in separate row.
I try to set the td width but all it did is just follow the td width of another row.

So somebody help me please.

Recommended Answers

All 2 Replies

Are you trying to make a row cell of a different width to rows above or below? You would need to either place a new table inside your table row (which gets messy very quickly) or you could increase the number of columns in your table and use the colspan attribute to dictate how many columns each cell takes up.

<tr>
  <td colspan="2"></td>
</tr>
<tr>
  <td colspan="1"></td>
</tr>

Here the first td will be twice as long as the one below. This will leave gaps and possibly make your table look pretty uneven though.

a little revision

<table>
    <tr>
       <td colspan="2"></td>
    </tr>
    <tr>
       <td></td>
       <td></td>
    </tr>
   <table>

if you want just create new table inside your <td></td> so you could set the table width different from another table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.