2012-03-09 53 views
1

我試圖做到的是:是否可以通過減價表中的表格左/右對齊文本?

Name Surname              Phone: 123 
Joe Cool               Fax: 123 
Charlie Brown              Email: 123 

Some more text goes here, after these two introductory columns. Normal text just 
keeps going, and going, and going ... 

是對齊文本的右列?是否有可能通過Markdown或者通過HTML或CSS表格來實現,但是通過這種方式,表格邊框不可見?

回答

1

這裏的HTML和CSS根據你的問題。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Untitled Document</title> 

<style type="text/css"> 
.panel-inside { 
    padding-left: 0px; 
    padding-right: 0px; 
    overflow:auto; 
} 

.row         
{ 
    height: 30px;  
    width:100%;   
    vertical-align:middle; 
} 

.label        
{ 
    font-size: 12pt; 
    display:inline;  
    float:left; 
    margin-left:5px; 
    width:200px; 
} 

.label-right 
{ 
    font-size: 12pt; 
    color:#686868; 
    display:inline;  
    float:right; 
    margin-right:7px; 
    width:200px; 
} 

.listSeparator     
{ 
    clear:both; 
    height:0; 
} 

</style> 
</head> 

<body> 

<div class="panel-inside"> 
    <div class="row"> 
     <div class="label">Name Surname </div> 
     <div class="label-right">Phone: 123</div> 
    </div> 
    <div class="listSeparator">&nbsp</div> 
    <div class="row"> 
     <div class="label">Joe Cool</div> 
     <div class="label-right">Fax: 123</div> 
    </div> 
    <div class="listSeparator">&nbsp</div> 
    <div class="row"> 
     <div class="label">Charlie Brown</div> 
     <div class="label-right">Email: 123</div> 
    </div> 
</div> 
<div id="content"> 
    <p>Some more text goes here, after these two introductory columns. Normal text just keeps going, and going, and going ... 
</p> 
</div> 

</body> 
</html> 

對於這裏輸出的是小提琴:http://jsfiddle.net/LsGSc/

+0

對不起迪內希。我完全忘記了這個問題(直到一分鐘之前有人高舉它)。 HTML方式看起來太複雜了,所以我只是在LaTeX中重寫了整個文檔。這是一個簡短的文件,但需要根據規範格式化。 – Rook 2012-09-10 03:32:01