472,967 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,967 software developers and data experts.

layout within <td>

How can I get the following to appear on just 1 line?

<style type="text/css">
#center { text-align: center;}
#left { text-align: left;}
#right {text-align: right}
</style>

<table border=1 width=200>
<tr>
<td>
<div id="left">left
<div id="center">center
<div id="right">right
</td>
</tr>
</table>

I tried using "display:inline" and play with "float" property but
couldn't get it to work right.
Thanks!

Radek

Jul 21 '05 #1
3 3612
On 10 May 2005 08:14:39 -0700, "Radek" <ra*********@firstlogic.com>
wrote:
How can I get the following to appear on just 1 line?


You want to be spoonfed?

Note that it is highly recommended to stay away from pixel sized
elements in a real design.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Your own title here</TITLE>
<style type="text/css">
body {
margin: 0; border: none; padding: 0;
font-size: 100%;
}
table {
margin: 0; padding: 0;
border: solid 1px #000000;
}
td {
margin: 0; border: none; padding: 0;
width: 210px;
}
.left {
margin: 0; border: none; padding: 0;
text-align: left; width: 70px; float: left;
}
.center {
margin: 0; border: none; padding: 0;
text-align: center; width: 70px; float: left;
}
.right {
margin: 0; border: none; padding: 0;
text-align: right; width: 70px; float: left;
}
</style>
</HEAD>
<BODY>
<table>
<tr>
<td>
<div class="left">left</DIV>
<div class="center">center</DIV>
<div class="right">right</DIV>
</td>
</tr>
</table>
</BODY>
</HTML>

--
Rex
Jul 21 '05 #2
*Radek*:
<tr><td>
<div id="left">left
<div id="center">center
<div id="right">right
</td></tr>


Any reason for not using three distinct table cells (or for not closing
your 'div' elements)?
Jul 21 '05 #3
Thanks for your help! Not closing the <div> elements was my mistake
(sorry). Putting everything in 3 different table cells that's
unfortunately is not an option. I'd also want to stay away from
hardcoding the pixel sizes. I'd be happy with the output that I'm
getting in my original example if everything was simply on 1 line (I
though that's what "display:inline" was supposed to do but that doesn't
seem to be the case).

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample...
2
by: js | last post by:
I have a table rendered with XSLT. The first column has a radio button controls for user to make a selection for a particular row. All the values in the remaining columns are all concated with a...
2
by: bissatch | last post by:
Hi, I am trying to use JavaScript to write a table column on a web page. The code is as follows: <html> <head> <script> function displaycount() {
3
by: RC | last post by:
I have a very sime html table like <html><head><title>My Table</title> <style> input { margin: 0; padding: 0; border-width: 0; text-indet: 0; text-align: left } </style></head><body> <table...
1
by: prefersgolfing | last post by:
I'm not using Master Pages, yet I'd like to display the contents of an HTML page within a <table><tr><td> on a .aspx. I have a lengthy guide already paginated in html. I'd like to embed the...
5
by: mahesr | last post by:
I want to match some particular text between <tr>and </tr> or <td>and </td>.... in PHP. like below............ <table><tr> CATEGORY: <td><font face="Verdana" size="1" color="#A000A0"> Wedding...
4
George Lft
by: George Lft | last post by:
I'm new at building table. Mostly PHP programming . Now I can't seem to fix the size of my table row and column. Any idea? <h4>Two rows and three columns:</h4> <table border="1"> <tr> ...
1
by: test9991014 | last post by:
Hi folks, I've got something like this: <table> <tr> <td>1</td> <td align=center> <input type=text> </td>
7
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why....
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.