@@ -29,6 +29,9 @@ use crate::html::highlight;
29
29
use crate :: html:: layout:: Page ;
30
30
use crate :: html:: markdown:: MarkdownSummaryLine ;
31
31
32
+ const ITEM_TABLE_OPEN : & ' static str = "<div class=\" item-table\" >" ;
33
+ const ITEM_TABLE_CLOSE : & ' static str = "</div>" ;
34
+
32
35
pub ( super ) fn print_item ( cx : & Context < ' _ > , item : & clean:: Item , buf : & mut Buffer , page : & Page < ' _ > ) {
33
36
debug_assert ! ( !item. is_stripped( ) ) ;
34
37
// Write the breadcrumb trail header for the top
@@ -263,14 +266,15 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
263
266
curty = myty;
264
267
} else if myty != curty {
265
268
if curty. is_some ( ) {
266
- w. write_str ( "</table>" ) ;
269
+ w. write_str ( ITEM_TABLE_CLOSE ) ;
267
270
}
268
271
curty = myty;
269
272
let ( short, name) = item_ty_to_strs ( myty. unwrap ( ) ) ;
270
273
write ! (
271
274
w,
272
275
"<h2 id=\" {id}\" class=\" section-header\" >\
273
- <a href=\" #{id}\" >{name}</a></h2>\n <table>",
276
+ <a href=\" #{id}\" >{name}</a></h2>\n {}",
277
+ ITEM_TABLE_OPEN ,
274
278
id = cx. derive_id( short. to_owned( ) ) ,
275
279
name = name
276
280
) ;
@@ -283,14 +287,14 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
283
287
match * src {
284
288
Some ( ref src) => write ! (
285
289
w,
286
- "<tr><td ><code>{}extern crate {} as {};" ,
290
+ "<div class= \" item-left \" ><code>{}extern crate {} as {};" ,
287
291
myitem. visibility. print_with_space( myitem. def_id, cx) ,
288
292
anchor( myitem. def_id. expect_real( ) , & * src. as_str( ) , cx) ,
289
293
myitem. name. as_ref( ) . unwrap( ) ,
290
294
) ,
291
295
None => write ! (
292
296
w,
293
- "<tr><td ><code>{}extern crate {};" ,
297
+ "<div class= \" item-left \" ><code>{}extern crate {};" ,
294
298
myitem. visibility. print_with_space( myitem. def_id, cx) ,
295
299
anchor(
296
300
myitem. def_id. expect_real( ) ,
@@ -299,7 +303,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
299
303
) ,
300
304
) ,
301
305
}
302
- w. write_str ( "</code></td></tr >" ) ;
306
+ w. write_str ( "</code></div >" ) ;
303
307
}
304
308
305
309
clean:: ImportItem ( ref import) => {
@@ -326,10 +330,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
326
330
327
331
write ! (
328
332
w,
329
- "<tr class=\" {stab}{add}import-item\" >\
330
- <td>< code>{vis}{imp}</code></td >\
331
- <td class= \" docblock-short \" >{stab_tags}</td >\
332
- </tr >",
333
+ "<div class=\" item-left {stab}{add}import-item\" >\
334
+ <code>{vis}{imp}</code>\
335
+ </div >\
336
+ <div class= \" item-right docblock-short \" >{stab_tags}</div >",
333
337
stab = stab. unwrap_or_default( ) ,
334
338
add = add,
335
339
vis = myitem. visibility. print_with_space( myitem. def_id, cx) ,
@@ -358,11 +362,11 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
358
362
let doc_value = myitem. doc_value ( ) . unwrap_or_default ( ) ;
359
363
write ! (
360
364
w,
361
- "<tr class=\" {stab}{add}module-item\" >\
362
- <td>< a class=\" {class}\" href=\" {href}\" \
363
- title=\" {title}\" >{name}</a>{unsafety_flag}</td> \
364
- <td class= \" docblock-short \" >{stab_tags}{docs}</td >\
365
- </tr >",
365
+ "<div class=\" item-left {stab}{add}module-item\" >\
366
+ <a class=\" {class}\" href=\" {href}\" \
367
+ title=\" {title}\" >{name}</a>{unsafety_flag}\
368
+ </div >\
369
+ <div class= \" item-right docblock-short \" >{stab_tags}{docs}</div >",
366
370
name = * myitem. name. as_ref( ) . unwrap( ) ,
367
371
stab_tags = extra_info_tags( myitem, item, cx. tcx( ) ) ,
368
372
docs = MarkdownSummaryLine ( & doc_value, & myitem. links( cx) ) . into_string( ) ,
@@ -382,7 +386,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
382
386
}
383
387
384
388
if curty. is_some ( ) {
385
- w. write_str ( "</table>" ) ;
389
+ w. write_str ( ITEM_TABLE_CLOSE ) ;
386
390
}
387
391
}
388
392
0 commit comments