473,382 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Let the margin left of a table be exactly 80 pixels ???

I would like to place a table <TABLE>...</TABLE> in such a way on a web page that
the margin left of it is exactly 80 pixels. Furthermore the width of the table should be
90% of the rest of the browser window (=the right part except the 80 pixels).

How do I specify these properties in a HTML code?

Ted

Jul 20 '05 #1
4 30776
in post: <news:c9*************@news.t-online.com>
Ted Mencini <te*******@hotmail.com> said:
I would like to place a table <TABLE>...</TABLE> in such a way on a
web page that the margin left of it is exactly 80 pixels. Furthermore
the width of the table should be 90% of the rest of the browser
window


div{margin-left:80px;margin-right:10%;}
table{width:100%;}

<div><table><tr><td>a table thingy</td></tr></table></div>
--
b r u c i e
Jul 20 '05 #2
On Wed, 26 May 2004 14:49:25 +0200, Ted Mencini <te*******@hotmail.com>
wrote:
I would like to place a table <TABLE>...</TABLE> in such a way on a web
page that the margin left of it is exactly 80 pixels. Furthermore the
width of the table should be 90% of the rest of the browser window (=the
right part except the 80 pixels). How do I specify these properties in a HTML code?


You don't. With CSS, you can come close. You can use something like this:
table {width: 90%; margin-left: 80px;}
.... were the width of the table is of course a little bigger than what you
asked. CSS doesn't have a rule to say '90 percent of what is left after
using a 80 pixel margin'.

Another option is to set a left-padding of 80px on the containing element,
presumably BODY, like this:

body {margin: 0; padding-left: 80px;}
table {width: 90%;}

.... which will work fine if you don't write complex pages with nested and
positioned DIVs and tables etc.

--
Rijk van Geijtenbeek

The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you
won't get any real work done. - J.Nielsen
Jul 20 '05 #3
On Wed, 26 May 2004 23:03:27 +1000, brucie <sh**@bruciesusenetshit.info>
wrote:
in post: <news:c9*************@news.t-online.com>
Ted Mencini <te*******@hotmail.com> said:
I would like to place a table <TABLE>...</TABLE> in such a way on a
web page that the margin left of it is exactly 80 pixels. Furthermore
the width of the table should be 90% of the rest of the browser
window


div{margin-left:80px;margin-right:10%;}
table{width:100%;}

<div><table><tr><td>a table thingy</td></tr></table></div>


To more precisely match OP's needs, I'd do:

div {margin-left:80px; margin-right:0;position: relative;}
table {width: 90%;}
Jul 20 '05 #4
Ted Mencini wrote:
I would like to place a table <TABLE>...</TABLE> in such a way on a web page that
the margin left of it is exactly 80 pixels. Furthermore the width of the table should be
90% of the rest of the browser window (=the right part except the 80 pixels).

How do I specify these properties in a HTML code?


div {
margin-left: 80px
}
table {
width: 90%
}

<div>
<table>
...
</table>
</div>

<http://www.fit.fraunhofer.de/~koch/ted_mencini.html>
Works at least with recent Mozilla, Opera, WinIE
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #5

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

Similar topics

4
by: Alex Bell | last post by:
I am developing at http://www.members.iinet.net.au/~abell1/test/index.htm with city.css at http://www.members.iinet.net.au/~abell1/test/city.css. Both validate. In index.htm there is a block of...
4
by: Peter Cartwright | last post by:
I've just been testing some menus which use margin-left applied to span and anchor elements. In IE6 it's fine. In IE4 margin-left seems only to apply to block elements. Frankly that doesn't concern...
0
by: Ted Mencini | last post by:
I would like to place a table <TABLE>...</TABLE> in such a way on a web page that the margin left of it is exactly 80 pixels. Furthermore the width of the table should be 90% of the rest of the...
1
by: Chris Pudney | last post by:
G'day, I am using CSS to construct bar charts from nested DIVs. In general this works fine. However, in certain circumstances I need to display multiple charts inline. To get consistent results...
1
by: aaron.reese | last post by:
Guys, this is my problem:- I have records which are linked by two fields on a left inner join (there may be 0,1 or more records in the right hand table) The relationship is not unique (it's...
8
by: speralta | last post by:
I'm playing around with a test page that uses a <div id="main"within the context of a body with a width of 100% to center a fixed width field on a page. For some reason, the page is not centering...
4
by: guywmustang | last post by:
I basically have this.... <div id="page"> <div id="leftPane"> picture previews </div> <div id="Picture"> A picture here </div> </div>
9
by: shanevanle | last post by:
I have two tables that are pretty big. I need about 10 rows in the left table and the right table is filtered to 5 rows as well. It seems when I join the tables in the FROM clause, I have to...
8
by: hzgt9b | last post by:
I am working on a site that is being served to a private network. All the users are using IE6+. I am having trouble getting the 1st div added to a containing div to have its margin-left applied...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.