Forum Moderators: mack

Message Too Old, No Replies

Entering Text Into A Table Or Cell

         

dloreski

10:01 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Hi everyone.
You all have been so helpful here.
When I'm entering text into a cell, the cell boarders expand when I enter it, after I get to a certain point.
How can I keep all of the boarders from moving or expanding while entering text?
- Dave

whoisgregg

3:55 am on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like you want to establish a specific width for your table cells. This can be done either for the entire table or on a cell-by-cell basis.

Cell by cell basis (HTML method)
In the first

<tr>
of your
<table>
code, add this code to each
<td>
:
<td width="75">

The width is in pixels and each

<td>
can have it's own width. Once you reach the first
<[b][red]/[/red][/b]tr>
don't bother adding any more width values as the first row's width's will be 'inherited' by the remaining rows.

Entire table (CSS method)
1. Add this styling to your external CSS file:

td { width: 75px; }

Or, 2. Add this code to the head of the document:

<style type="text/css">
<!--
td { width: 75px; }
-->
</style>

Hope this helps and welcome to WebmasterWorld, dloreski!

MatrixBrains

10:36 am on Jan 29, 2005 (gmt 0)

10+ Year Member



Alternately, you can specify table width
<table width="400">
<tr>
<td> you text here
</td>
</tr>
</table>

This way you dont have to repeat for every cell.

This can also be done in css format as explained in previous post. Just replace td with table

Hope that this helps.

Regards,
MB

whoisgregg

8:36 pm on Jan 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good point, MatrixBrains -- somehow I assumed dloreski wanted to control the width of each cell not just the width of the whole table. Thanks for adding that info. :)