2016-09-30 192 views
0

目前,我有這樣的:如何減少區域的寬度?

enter image description here

我想劃定3個元素有這樣的事情:

enter image description here

<th class="fc-day-header fc-widget-header fc-sat" data-date="2016-10-01">JOUR 1<br>samedi 1 octobre</th> 

我試圖減少寬度的fc-day-header類,但沒有任何改變。

我在CSS上很糟糕,所以我不知道該怎麼做。

有想法嗎?

編輯:HTML結構:

<table> 
    <thead> 
    <tr> 
     <th class="fc-axis fc-widget-header" style="width:18px"></th><th class="fc-day-header fc-widget-header fc-sat" data-date="2016-10-01" style="width:70%;">JOUR 1<br>samedi 1 octobre</th> 
     <th class="fc-day-header fc-widget-header fc-sun" data-date="2016-10-02">JOUR 2<br>dimanche 2 octobre</th> 
     <th class="fc-day-header fc-widget-header fc-mon" data-date="2016-10-03">JOUR 3<br>lundi 3 octobre</th> 
    </tr> 
    </thead> 
</table> 

HTML和CSS的是不是我的,它們是由完整的日曆生成。

我只能通過javascript修改它們。

+0

許多想法...使用3周的div ...使用3個跨...使用3華里....不要使用表....使用Flexbox的....使用float ...使用inline-block .... Whitout看到足夠的代碼很難幫助你。 – DaniP

+0

爲您的單元格添加邊距。對於具體的建議,我們需要看看你到目前爲止的CSS。 – theJoi

+1

向我們展示html結構 – Keith

回答

1

您可以使用border-spacing屬性來分隔出每個單元格。

https://jsfiddle.net/3xe5mzmx/

<table> 
    <thead> 
    <tr> 
     <th class="fc-axis fc-widget-header" style="width:18px"></th> 
     <th class="fc-day-header fc-widget-header fc-sat" data-date="2016-10-01">JOUR 1<br>samedi 1 octobre</th> 
     <th class="fc-day-header fc-widget-header fc-sun" data-date="2016-10-02">JOUR 2<br>dimanche 2 octobre</th> 
     <th class="fc-day-header fc-widget-header fc-mon" data-date="2016-10-03">JOUR 3<br>lundi 3 octobre</th> 
    </tr> 
    </thead> 
</table> 

table { 
    width: 100%; 
    border-spacing: 15px 10px; 
    border-collapse: separate; 
} 
th { 
    border: 1px solid black; 
} 
0

您應該使用3個獨立的div s,即使用margin-leftmargin right

+0

我無法做到這一點,它是動態生成的,它是一個日曆..它甚至不是我的完整日曆。 –

+0

@DimitriDanilov - 當你沒有發佈任何代碼並且沒有關於你正在使用的細節時,任何人都應該知道這一點。 – j08691

+0

你是什麼意思?「它甚至不是我的完整日曆。」?你有權訪問代碼嗎?編輯:好吧,我得到你。 – Vincent